import unittest
from planisphere import Room

class testRoom(unittest.TestCase):
    def test_room(self):
        gold=Room("GoldRoom","""This room has gold in it you can grab .There's a door to the north.""")
        self.assertEqual(gold.name,"GoldRoom")
        self.assertEqual(gold.paths,{})
        print("test_room")

    def test_room_paths(self):
        center=Room("Center","Test room in the center.")
        north=Room("North","Test room in the north.")
        south=Room("South","Test root in the sourth.")

        center.add_paths({'north':north,'south':south})
        north.add_paths({'center':center,'south':south})
        south.add_paths({'center':center,'north':north})
        print("test_room_paths")

    def test_map(self):
        start=Room("Start","You can og west and down a hole.")
        west=Room("Trees","There are trees here,you can go east.")
        down=Room("Dungeon","It's dark down here, you can go up.")

        start.add_paths({'west':west,'down':down})
        west.add_paths({'east':start})
        down.add_paths({'up':start})

        self.assertEqual(start.go('west'),west)
        self.assertEqual(start.go('west').go('east'),start)
        self.assertEqual(start.go('down').go('up'),start)
        print("test_map")
